<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="shortcut icon" href="__STATIC__/logo.ico" />
    <link rel="stylesheet" href="__STATIC__/assets/arr_css/bootstrap.min.css">
    <link rel="stylesheet" href="__STATIC__/assets/order/headtwo.css">
    <!-- <link href="__STATIC__/layer/layui.css" rel="stylesheet" type="text/css" /> -->
    <title>账户信息</title>
    <link rel="stylesheet" href="__STATIC__/assets/account/account.css">
    <link href="__STATIC__/layer/layui.css" rel="stylesheet" type="text/css" />


</head>

<body>
    {include file="public/core_top"}
    <div class="content">
        {include file="public/left"}
        <div class="content_right" style="margin-top:20px;">
            <div class="content_right_title">账户信息</div>

            <form class="layui-form" lay-filter="example" id="formData" style="padding-top: 10px; border-top: 1px solid #e83f44">
                <!-- <div class="layui-form-item" style="margin-bottom: 5px;">
                    <label class="layui-form-label" style="width: 90px;">账号昵称</label>
                    <div class="layui-input-block">
                        <input type="text" name="idname" lay-verify="title" autocomplete="off" placeholder="" class="layui-input" style="width: 200px;">
                    </div>
                </div> -->
                <div class="layui-form-item" style="margin-bottom: 5px;">
                    <label class="layui-form-label" style="width: 90px;">真实姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="user_name" lay-verify="title" autocomplete="off" placeholder="" class="layui-input" style="width: 200px;" id="name">
                    </div>
                </div>


                <div class="layui-form-item" style="margin-bottom: 5px;display:flex;">
                    <label class="layui-form-label" style="width: 90px;">性别</label>
                    <div class="layui-input-block" style="margin-left:20px;">
                        <select name="sex" lay-filter="aihao">
                            <option value=""></option>
                            <option value="0" selected="">保密</option>
                            <option value="1" >男</option>
                            <option value="2">女</option>
                        </select>
                    </div>
                    <div class="layui-inline" style="margin-bottom: 5px;">
                        <label class="layui-form-label" style="width: 90px;margin-right: 20px;">生日</label>
                        <div class="layui-input-inline">
                            <input type="date" name="birthday" class="layui-input">
                            <!-- <input type="date"> -->
                        </div>
                    </div>
                </div>

                <div class="layui-form-item" style="margin-bottom: 5px;">
                    <label class="layui-form-label" style="width: 90px;">所在地区</label>
                    <div class="layui-input-block">
                        <input type="text" name="region" lay-verify="title" autocomplete="off" placeholder="" class="layui-input" style="width: 515px;" id="region">
                    </div>
                </div>
                <!-- <div class="layui-form-item" style="margin-bottom: 15px;">
                    <div class="layui-inline">
                        <label class="layui-form-label" style="width: 90px;margin-right: 20px;">手机号码</label>
                        <div class="layui-input-inline">
                            <input type="tel" name="phone" lay-verify="required|phone" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div> -->

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <div class="layui-btn" onclick="tijiao()"  style="background: #e83f44;border-radius: 5px;" >立即保存</div>
                    </div>
                </div>
            </form>

            <script>



            </script>



        </div>


    </div>

    {include file="public/core_footer"}


</body>
<script src="__STATIC__/assets/arr_css/jquery-3.3.1.js"></script>
<script type="text/javascript" src="__STATIC__/assets/arr_css/jquery.SuperSlide2.js"></script>
<script src="__STATIC__/assets/arr_css/bootstrap.min.js"></script>
<script src="__STATIC__/assets/account/layui/layui.js"></script>
<script src="__STATIC__/assets/account/account.js"></script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form,
            layer = layui.layer,
            layedit = layui.layedit,
            laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //创建一个编辑器
        var editIndex = layedit.build('LAY_demo_editor');

        //自定义验证规则
        form.verify({
            title: function (value) {
                if (value.length < 2) {
                    return '请输入至少两个字符';
                }
            }
        });

        
        


        // form.val('example', {
        //     "idname": "莫愁商城",
        //     "zsname": "ONE",
        //     "phone": "",
        //     "sex": "男",
        //     "date": "",
        //     "dizhi": "湖北武汉江岸区建设大道广发银行大厦36F"
        // })
    });



    function tijiao()
        {

            var name = $('#name').val();
            var region = $('#region').val();
            if (name == '' || region =='') {
                alert('信息不能为空!');
            }else{
                $.ajax({
                    type: "POST",
                    url: "{:url('Core/add')}",
                    data: $('#formData').serialize(), // 要提交的表单 
                    success: function (data) {
                        // console.log(data);
                        if (data == '1') {
                            //提示层
                            alert('保存成功!');
                        } else {
                            //提示层
                            alert('保存失败!');
                        }
                    
                    }
                });
            }

            
        }
</script>

</html>